This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
"And - If your @formula code works ... shouldn't it be used?"
No. Just because it works now doesn't mean it will always work. Some other programmer may make a mistake in some other code, document fields that should be numeric are now saved as text, and your "working" formula grinds to a halt. Now you have to figure out what's wrong. How do you debug it? By sticking to your old formula, you've just thrown away a major benefit to LotusScript.
And for maintenance purposes, it's easier to find people who know VB and can start updating or migrating LotusScript, than it is to find people who know formula.
By far and away, the biggest use of Evaluate I've seen is to act as a crutch for developers to not have to learn LotusScript.
C API?? Are you nuts?? :P
Erik C. Brooks is correct in that there doesn't appear to be a 255 character limit on Evaluate. I'm trying to review now why I thought that. I think I might have been thinking of @Eval where the argument was extracted using even more formula, and the process imposed a limit of 255 character strings. I don't have the code anymore so I'm trying to remember what it was.
Still, even without the limit, LotusScript is better for dynamic coding for the other reasons given, as well as the fact that you can have UI functions in Execute but not in Evaluate. In fact, you can perform just about any operation you want.
Sub Click(Source As Button) Dim script As String, retcode As Integer script$ = {Sub Initialize Dim documentnode As Variant Dim eobject As Variant Dim fullxmlfilename As String Dim flag As Boolean Dim parser As NotesDOMParser Dim stream As NotesStream Dim thisns As New NotesSession Dim urldoc As NotesDocument Dim urlstring As String urlstring = |http://local.yahooapis.com/MapsService/V1/geocode?appid=YD-9G7bey8_JXxQP6rxl.fBFGgCdNjoDMACQA--&street=701+First+Ave&city=Sunnyvale&state=CA&output=xml| Set urldoc = thisns.CurrentDatabase.GetDocumentByURL( urlstring ) fullxmlfilename = Environ$ ( "TMP" ) & "\" & "returned.xml" If Dir( fullxmlfilename ) <> "" Then Kill fullxmlfilename If urldoc.HasEmbedded Then Forall item In urldoc.Items If item.Type = ATTACHMENT Then Set eobject = urldoc.GetAttachment( item.Values( 0 ) ) End Forall Else Msgbox( "no embedded objects found") Exit Sub End If Call eobject.extractFile( fullxmlfilename ) Set stream = thisns.CreateStream flag = stream.Open( fullxmlfilename ) Set parser = thisns.CreateDOMParser( stream ) Call parser.Parse Set documentnode = parser.Document.DocumentElement Call stream.Close Kill fullxmlfilename msgbox( documentnode.nodename ) End Sub} retcode% = Execute ( script$ ) End Sub
Feedback response number WLOO7YT233 created by ~Julia Feztoosterader on 12/16/2009